/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package client;

import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import ServicesAccessData.Admin;

/**
 *
 * @author huy
 */
public class NonblockingClientAdmin {

    private void invoke() {
        TTransport transport;
        try {
            transport = new TFramedTransport(new TSocket("localhost", 7912));
            TProtocol protocol = new TBinaryProtocol(transport);

            Admin.Client client = new Admin.Client(protocol);
            transport.open();

            /*Gọi các phương thức trong service tại đây*/
            
            
            System.out.println(client.searchStatusByContent("vui", "0", "10", "1"));
            transport.close();
        } catch (TTransportException e) {
            e.printStackTrace();
        } catch (TException e) {
            e.printStackTrace();
        }
    }
    public static void main(String[] args) {
        NonblockingClientAdmin c = new NonblockingClientAdmin();
        c.invoke();
    }
}